<?php

use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

$collection = new RouteCollection();


// Sites
$collection->add('site_home', new Route('/', array(
    '_controller' => 'StoreBundle:Sites\Home:index',
), array(), array(), '{sub_domain}.sym.dev'));


$collection->add('store_homepage', new Route('/hello/{name}', array(
    '_controller' => 'StoreBundle:Default:index',
)));

$collection->add('home_index', new Route('/', array(
    '_controller' => 'StoreBundle:Home:index'  
)));

$collection->add('post_detail', new Route('/post/detail/{id}', array(
    '_controller' => 'StoreBundle:Home:detail'  
)));

// Admin route
$collection->add('admin_post_index', new Route('/admin/post', array(
    '_controller' => 'StoreBundle:Admin\Post:index'  
)));

$collection->add('admin_post_add', new Route('/admin/post/add', array(
    '_controller' => 'StoreBundle:Admin\Post:add'  
)));

$collection->add('admin_post_update', new Route('/admin/post/update/{id}', array(
    '_controller' => 'StoreBundle:Admin\Post:update'
)));

$collection->add('admin_post_delete', new Route('/admin/post/delete/{id}', array (
    '_controller' => 'StoreBundle:Admin\Post:delete'
)));

$collection->add('comment_add', new Route('/comment/add', array (
    '_controller' => 'StoreBundle:Home:addComment'   
)));

$collection->add('comment_more', new Route('/comment/more', array(
    '_controller' => 'StoreBundle:Home:moreComment'
)));

$collection->add('comment_item', new Route('/comment/get-comments/{postId}', array(
    '_controller' => 'StoreBundle:Home:getComments'
)));


/**
 * Admin Route
 */ 
$collection->add('admin_login', new Route('/login', array(
    '_controller' => 'StoreBundle:Security:login',
)));
$collection->add('login_check', new Route('/login_check', array()));
$collection->add('admin_logout', new Route('logout', array()));

// Get page header for admin
$collection->add('admin_get_page_header', new Route('/admin/get-page-header/{title}', array (
    '_controller' => 'StoreBundle:Admin:getPageHeader'
)));

// Admin user manager
$collection->add('admin_user_index', new Route('/admin/user', array(
    '_controller' => 'StoreBundle:Admin\User:index'
)));

$collection->add('admin_user_add', new Route('/admin/user/add', array(
    '_controller' => 'StoreBundle:Admin\User:add'
)));

$collection->add('admin_user_create', new Route('/admin/user/create', array(
    '_controller' => 'StoreBundle:Admin\User:create'
)));

return $collection;
